import React, { Component } from "react";
import homeBg from '@/assets/images/homeBg.jpg'
import '../style/style.less'
class Home extends Component {

    state = {

    }
    async componentDidMount() {
        setTimeout(() => {

            document.getElementById('viewport').setAttribute('content', 'width=device-width,initial-scale=0.1,user-scalable=yes');
        }, 300)
    }

    getRatio() {
        var ratio = 0;
        var screen = window.screen;
        var ua = navigator.userAgent.toLowerCase();

        if (window.devicePixelRatio !== undefined) {
            ratio = window.devicePixelRatio;
        }
        else if (~ua.indexOf('msie')) {
            if (screen.deviceXDPI && screen.logicalXDPI) {
                ratio = screen.deviceXDPI / screen.logicalXDPI;
            }

        }
        else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
            ratio = window.outerWidth / window.innerWidth;
        }

        if (ratio) {
            ratio = Math.round(ratio * 100);
        }
        return ratio;
    }

    render() {
        const { dateType, editMode } = this.props;
        return <div id="viewport" style={{
            padding: '0 20px 20px',
        }} className="configuration" >
            <img src={homeBg} className="homeBg" alt="" />
        </div>
    }
}

export default Home;